package com.asistencia.businness;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import com.asistencia.dao.interfaces.CourseDao;
import com.asistencia.domain.Course;
import com.asistencia.domain.Semester;

@Service
public class CourseBusinness {

	@Autowired
	CourseDao courseDao;

	public Course getCourseById(Integer idCourse) {
		try {
			return courseDao.getById(idCourse);
		} catch (Exception e) {
			return null;
		}
	}

	public List<Course> listAll() {
		try {
			courseDao.listAll();
			List<Course> listAll = courseDao.listAll();
			return listAll;
		} catch (DataAccessException e) {
			e.printStackTrace();
			return null;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}

}
